<?php

namespace App\Jobs;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Notification;
use App\Mail\EmailTemplate;
use Illuminate\Support\Facades\Mail;

class SendEmailHandle implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
    protected $datas;
    
    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($datas)
    {
        //
        $this->datas = $datas;
        
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        //
       
        Mail::to($this->datas['email'])->send(new EmailTemplate($this->datas));
        
    }
}
